package com.aspose.cells.b.a.b;

import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Float;

public final class zq {
   private float a;
   private float b;
   private float c;
   private float d;

   public zq(Rectangle2D var1) {
      this.a = (float)var1.getX();
      this.b = (float)var1.getY();
      this.c = (float)var1.getWidth();
      this.d = (float)var1.getHeight();
   }

   public zq a() {
      return new zq(this.a, this.b, this.c, this.d);
   }

   public final Rectangle2D b() {
      return new Float(this.f(), this.g(), this.h(), this.i());
   }

   public void a(float var1, float var2) {
      this.a -= var1;
      this.b -= var2;
      this.c += var1 * 2.0F;
      this.d += var2 * 2.0F;
   }

   public static zq a(zq var0, zq var1) {
      return a(Math.min(var0.j(), var1.j()), Math.min(var0.k(), var1.k()), Math.max(var0.l(), var1.l()), Math.max(var0.m(), var1.m()));
   }

   public void a(float var1) {
      this.a = var1;
   }

   public void b(float var1) {
      this.b = var1;
   }

   public void c(float var1) {
      this.c = var1;
   }

   public void d(float var1) {
      this.d = var1;
   }

   public void a(zt var1) {
      this.c = var1.b();
      this.d = var1.c();
   }

   public void a(zo var1) {
      this.a = var1.d();
      this.b = var1.e();
   }

   public static zq c() {
      return new zq(0.0F, 0.0F, 0.0F, 0.0F);
   }

   public zq() {
      this.a = 0.0F;
      this.b = 0.0F;
      this.c = 0.0F;
      this.d = 0.0F;
   }

   public zq(float var1, float var2, float var3, float var4) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
      this.d = var4;
   }

   public zq(zo var1, zt var2) {
      this.a = var1.d();
      this.b = var1.e();
      this.c = var2.b();
      this.d = var2.c();
   }

   public static zq a(float var0, float var1, float var2, float var3) {
      return new zq(var0, var1, var2 - var0, var3 - var1);
   }

   public zo d() {
      return new zo(this.a, this.b);
   }

   public zt e() {
      return new zt(this.c, this.d);
   }

   public float f() {
      return this.a;
   }

   public float g() {
      return this.b;
   }

   public float h() {
      return this.c;
   }

   public float i() {
      return this.d;
   }

   public float j() {
      return this.a;
   }

   public float k() {
      return this.b;
   }

   public float l() {
      return this.a + this.c;
   }

   public float m() {
      return this.b + this.d;
   }

   public boolean n() {
      return this.c <= 0.0F || this.d <= 0.0F;
   }

   public int hashCode() {
      return (int)((long)this.a ^ ((long)this.b << 13 | (long)this.b >> 19) ^ ((long)this.c << 26 | (long)this.c >> 6) ^ ((long)this.d << 7 | (long)this.d >> 25));
   }

   public boolean equals(Object obj) {
      return obj instanceof zq && b(this, (zq)obj);
   }

   public static boolean b(zq var0, zq var1) {
      if (var0 == var1) {
         return true;
      } else {
         return var0 != null && var1 != null && var0.a == var1.a && var0.b == var1.b && var0.c == var1.c && var0.d == var1.d;
      }
   }

   public String toString() {
      return "{X=" + this.a + ",Y=" + this.b + ",Width=" + this.c + ",Height=" + this.d + "}";
   }

   public void a(zq var1) {
      Float var2 = new Float(var1.a, var1.b, var1.c, var1.d);
      Float var3 = new Float(this.a, this.b, this.c, this.d);
      Rectangle2D.intersect(var2, var3, var2);
      if (var2.getHeight() > 0.0D && var2.getWidth() > 0.0D) {
         this.a = (float)var2.getX();
         this.b = (float)var2.getY();
         this.c = (float)var2.getWidth();
         this.d = (float)var2.getHeight();
      } else {
         this.a = 0.0F;
         this.b = 0.0F;
         this.c = 0.0F;
         this.d = 0.0F;
      }

   }
}
